<?xml version="1.0" encoding="windows-1252"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <f:metadata>
        <f:event type="preRenderView" listener="#{TorrentBean.checkIfTorrentExists}"/>
    </f:metadata>
    <h:head>

    </h:head>
    <h:body>
        <ui:composition template="WEB-INF/facelets/Template.xhtml">
            <ui:define name="content">
                Name: <h:outputText value="#{TorrentBean.currentTorrent.name}" /><br/>
                Date: <h:outputText value="#{TorrentBean.currentTorrent.date}" /><br/>
                Location: <h:outputText value="#{TorrentBean.currentTorrent.location}" /><br/>
                Size: <h:outputText value="#{TorrentBean.currentTorrent.size}" /><br/>
                Uploader: <h:outputText value="#{TorrentBean.currentTorrent.user.username}" /><br/>
                <h:form>
                    <h:inputTextarea value="#{TorrentBean.comment}"/>
                    <h:commandButton id="btnOK" value="Add comment"
                                     actionListener="#{TorrentBean.addComment}" />
                </h:form>
                <ui:repeat value="#{TorrentBean.currentTorrent.comments}" var="comment">
                    <li>
                    <h:outputText value="#{comment.author.username} said.." /> <br/>
                    <h:outputText value="#{comment.comment}" /> <br/>
                    </li>
                </ui:repeat>
            </ui:define>
        </ui:composition>

    </h:body>
</html>
